package com.foreknow.service.impl;

import com.foreknow.dao.ConstantItemMapper;
import com.foreknow.entity.ConstantItem;
import com.foreknow.service.ConstantItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ConstantItemServiceImpl implements ConstantItemService {

    @Autowired
    public ConstantItemMapper constantItemMapper;

    @Override
    public List<ConstantItem> queryConstantItemByTypeId(Integer typeId) {
        return constantItemMapper.findConstantItemByTypeId(typeId);
    }

    @Override
    public int insertCons(ConstantItem constantItem) {
        return constantItemMapper.insertSelective(constantItem);
    }

    @Override
    public int deleteConsById(int id) {
        return constantItemMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int deleteConsByIds(List<Integer> ids) {
        return constantItemMapper.deleteConsByIds(ids);
    }

    @Override
    public int updateById(ConstantItem constantItem) {
        return constantItemMapper.updateByPrimaryKeySelective(constantItem);
    }

    @Override
    public ConstantItem findConsById(int id) {
        return constantItemMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<ConstantItem> findConsByPage(String params) {
        return constantItemMapper.findConsByPage(params);
    }

    @Override
    public List<ConstantItem> hightSerchCos(ConstantItem constantItem) {
        return constantItemMapper.hightSerch(constantItem);
    }

}
